﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:k="clr-namespace:personalplaner.common.themes">

    <!-- 
    *****************************************************************
    TabControl Template for the menu in the Gray Style
    *****************************************************************
    -->
    <Style TargetType="{x:Type TabControl}" x:Key="{x:Static k:ResourceKeys.MainMenuTabControlStyleKey}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <Border Background="Transparent" Grid.Row="0" CornerRadius="0" Margin="170,0,0,0" >
                            <TabPanel x:Name="HeaderPanel" Grid.Row="0" IsItemsHost="True" KeyboardNavigation.TabIndex="1" Background="Transparent" />
                        </Border>

                        <Border x:Name="Border" Grid.Row="1" Background="Transparent" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2">
                            <ContentPresenter x:Name="PART_SelectedContentHost" Margin="0,1,0,0" ContentSource="SelectedContent" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!-- 
    *****************************************************************
    TabItem Template for the menu in the Gray Style
    *****************************************************************
    -->
    <Style TargetType="{x:Type TabItem}" x:Key="{x:Static k:ResourceKeys.MainMenuTabItemStyleKey}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="#80AAAAAA" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="#80AAAAAA" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="#80AAAAAA" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="#80AAAAAA" />
                                        </ColorAnimationUsingKeyFrames>

                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="#80AAAAAA" />
                                        </ColorAnimationUsingKeyFrames>

                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="Orange" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <!--<VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="Disabled" />
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                                <EasingColorKeyFrame KeyTime="0" Value="#6D6D6D"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>-->
                        </VisualStateManager.VisualStateGroups>

                        <Grid Margin="5,0,5,0">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition Height="3"/>
                            </Grid.RowDefinitions>

                            <Border x:Name="Border" Height="40" Padding="8,5,8,5" BorderThickness="2,2,2,0.5" >
                                <Border.BorderBrush>
                                    <SolidColorBrush Color="Transparent" />
                                </Border.BorderBrush>
                                <Border.Background>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStopCollection>
                                                <GradientStop Color="Transparent" Offset="0.0" />
                                                <GradientStop Color="Transparent" Offset="0.2" />
                                                <GradientStop Color="Transparent" Offset="0.7" />
                                                <GradientStop Color="Transparent" Offset="1.0" />
                                            </GradientStopCollection>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <ContentControl Foreground="{DynamicResource {x:Static k:ResourceKeys.ForegroundBrush}}" FontWeight="Heavy" >
                                    <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" />
                                </ContentControl>
                            </Border>
                            <Border x:Name="OuterBorder" BorderThickness="0,0,0,3" BorderBrush="Transparent" Grid.Row="1"/>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <!--<Setter TargetName="Border" Property="Margin" Value="-1,-1,-4,0"/>-->
                            <!--<Setter TargetName="Border" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStopCollection>
                                                <GradientStop Color="#AAAAAA" Offset="0.0" />
                                                <GradientStop Color="#6D6D6D" Offset="1.0" />
                                            </GradientStopCollection>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="Border" Property="BorderBrush">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource CustomTabBorderMediumColor}" />
                                </Setter.Value>
                            </Setter>-->
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.5"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>